'use strict';

var webpack = require('webpack');

module.exports = {
  output: {
    path : __dirname + '/dist/js',
    filename : '[name].js'
  },

  cache: true,
  debug: true,
  devtool: 'inline-source-map',
  entry: {
    //testCommon : ['webpack/hot/only-dev-server', './src/test/testCommon.js']
    main : ['webpack/hot/only-dev-server', 'react-hot-loader', './src/main.js']
  },
  stats: {
    colors: true,
    reasons: true
  },
  context: __dirname,
  node: {
    __dirname: true
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()
  ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loaders: ['react-hot-loader/webpack', 'babel?' + JSON.stringify({presets: ['react', 'es2015', 'stage-0'], plugins: ['transform-decorators-legacy']})]
      },
      {
        test: /\.css$/,
        loader: "style!css"
      },
      {
        test: /\.(png|jpg|gif)$/,
        loader: 'url-loader?limit=8192'
      }
    ]
  }
};
